import { Component } from '@angular/core';
const electron = require('electron');
const remote = electron.remote;

@Component({
    selector: 'app',
    template:
    //templateUrl:
    //'./src/app.component.html',
    `
<h1 class="app">{{title}}</h1>
<button (click)="send();">send message</button>
<h3>{{message}}</h3>
`,
    styleUrls: ['./src/app.component.css']
})

export class AppComponent {
    title = 'Hello electron and Angular!';
    message = 'abc';

    constructor() {
    }

    send(): void {
        this.title = 'big bunny';
        console.log('click send');
        // const modalPath = require('path').join(`file://${}/app.modal.html`);
        remote.dialog.showOpenDialog({
            properties: ['openFile', 'openDirectory']
        }, (files) => {
            this.message = `you selected: ${files}`;
            console.log(this.message);
        });
    }
}
